/*
 * ListenerPort.h
 *
 *  Created on: Mar 16, 2009
 *      Author: Andrzej Olchawa
 *      mailto: andrzejolchawa@gmail.com
 *      http://www.hardtechnology.org
 *      This is a part of the Armazd project, which is covered by
 *      GNU GPL v2 license.
 */

#ifndef LISTENERPORT_H_
#define LISTENERPORT_H_

/* Include section */
#include <iostream>
#include <sys/socket.h>
#include <netinet/ip.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>

#include "DataSenderManager.h"
#include "AgentException.h"
#include "HTFramework/HTThread.h"
#include "Listener.h"

/* namespace declaration */
using namespace std;

/* ListenerPort class definition */
class ListenerPort : public HTThread<ListenerPort>, public Listener
{

private:

	int hSocket;
	int port;
	struct sockaddr_in addr;

	void initListener();

public:

	/* Constructors and destructor */
	ListenerPort();
	ListenerPort(string, int);
	virtual ~ListenerPort();

	void run();
};

#endif /* LISTENERPORT_H_ */
